{% extends 'book/layout.html' %} {% block body %}
<div class="example">
	<h3>{{ author.name }}的所有作品</h3>
	{% load static %}
    <ul class="listview image media-list">
    {% for book in author.books %}
    <li class="media">
        <div class="icon media-left">
            <a href="{% url 'book:item' book.slug %}">
                {% include 'book/_cover.html' %}               
            </a>
        </div>
        <div class="data media-body">
            <h4 class="media-heading"><a style="color:#000;" href="{% url 'book:item' book.slug %}">{{ book.title }}</a></h4>
            {% if book.summary %}
                {{ book.summary|safe|truncatechars_html:200 }}
            {% else %}
                <p>无</p>
            {% endif %}

            {% for ba in book.authors.all %}
                <a href="{% url 'book:author' ba.slug %}">{{ ba.name }}</a>
            {% endfor %}
        </div>
    </li>
    {% empty  %}
    <li>找不到^_^</li>
    {% endfor %}
</ul>
</div>
{% endblock %}